﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemplateManager.aspx.cs"
    Inherits="Card.Manager.TemplateManager" %>

<%@ Import Namespace="Card.Utility" %>
<%@ Register Src="Controls/DispartPage.ascx" TagName="pager" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>模板管理</title>
    <link href="Css/Style.css" rel="Stylesheet" type="text/css" />

    <script src="JavaScript/jquery-1.8.3.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        function createThumbnail(id,src) {
            var url = '<%=Card.Utility.ImageUtilty.ImageServer + "/ImageService.ashx?a=ct&id=" %>' + id;
            $.get("Handler.ashx?url=" + escape(url), function(data) {
                var result = eval("(" + data + ")");
                if (result.r == "y") {
                    alert("生成成功");
                    $("#tImgID_" + id).attr("src", src + "?r=" + new Date().getMilliseconds());
                } else {
                    alert(result.msg);
                }
            });
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <table class="TB">
        <tr>
            
            <td style="width: 20%" class="TD_Input_Text">
                名称或ID(模糊)：
            </td>
            <td class="TD_Input" colspan="3">
                <asp:TextBox ID="txtName" Width="70%" MaxLength="50" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="TD_Input_Text" style="width: 20%">
                类别：
            </td>
            <td class="TD_Input" style="width: 30%">
                <asp:DropDownList ID="dropTemplateType" runat="server">
                    <asp:ListItem>----全部----</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="TD_Input_Text" style="width: 20%">
                颜色：
            </td>
            <td class="TD_Input" style="width: 30%">
                <asp:DropDownList ID="dropColor" runat="server">
                    <asp:ListItem>----全部----</asp:ListItem>
                </asp:DropDownList>
            </td>            
        </tr>
        <tr>
            <td class="TD_Input_Text">
                板式：
            </td>
            <td class="TD_Input">
                <asp:DropDownList ID="dropStyle" runat="server">
                    <asp:ListItem Value="">----全部----</asp:ListItem>
                    <asp:ListItem Value="H">横版</asp:ListItem>
                    <asp:ListItem Value="V">竖版</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="TD_Input_Text">
                状态：
            </td>
            <td class="TD_Input">
                <asp:DropDownList ID="dropStatus" runat="server">
                    <asp:ListItem Value="">----全部----</asp:ListItem>
                    <asp:ListItem Value="B">建设中</asp:ListItem>
                    <asp:ListItem Value="Y">启用</asp:ListItem>
                    <asp:ListItem Value="N">禁用</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="4" align="center" class="TD_Input">
                <asp:Button ID="btnQuery" runat="server" Text="查询" />
                <input id="btnAdd" type="button" onclick="javascript:window.location='TemplateEdit.aspx';"
                    value="添加" />
            </td>
        </tr>
        <tr style=" display:none;">
            <td colspan="4" class="TD_Input">
                <span style="float: right">显示条数：
                    <asp:TextBox ID="txtRecords" runat="server" Text="50" MaxLength="3" CssClass="Input_Short"></asp:TextBox>
                </span>
            </td>
        </tr>
        <tr>
            <td colspan="4" class="TD_Input">
                <asp:Repeater ID="rptList" runat="server">
                    <HeaderTemplate>
                        <div>
                            <ul style=" list-style:none;">
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li style="float:left; padding-left:10px; padding-bottom:10px;">
                            <table width="380px;" border="1">
                                <tr class="TB_Alter">
                                    <td rowspan="5" style=" width:200px;" align="center" valign="middle">
                                        <img src="<%# ImageUtilty.GetTemplateListImagePath(Eval("FRONT_IMAGE").ToString()) %>" id="tImgID_<%# Eval("ID")%>"
                                            alt='<%# Eval("NAME") %>'>
                                            <a href="javascript:void(0);createThumbnail('<%# Eval("ID")%>','<%# ImageUtilty.GetTemplateListImagePath(Eval("FRONT_IMAGE").ToString()) %>')">生成缩略图</a>
                                    </td>
                                    <td style=" width:25px;">
                                        ID
                                    </td>
                                    <td>
                                        <%#  Eval("ID") %>
                                    </td>
                                </tr>
                                <tr class="TB_Item">
                                    <td>
                                        名称
                                    </td>
                                    <td>
                                        <%#  Eval("NAME")%>
                                    </td>
                                </tr>
                                <tr class="TB_Alter">
                                    <td>
                                        版式
                                    </td>
                                    <td>
                                        <%#  Eval("STYLE")%>
                                    </td>
                                </tr>
                                <tr class="TB_Item">
                                    <td>
                                        状态
                                    </td>
                                    <td>
                                        <%#  this.GetStatusDesc(Eval("STATUS").ToString()) %>
                                    </td>
                                </tr>
                                <tr class="TB_Alter">
                                    <td colspan="2" align="center">
                                        <asp:LinkButton ID="lbtnDelete" CommandName="DELETE" CommandArgument='<%#  Eval("ID") %>' OnClientClick="javascript:return confirm('确定删除该模版？')"
                                            runat="server">删除</asp:LinkButton>| <a href="TemplateEdit.aspx?tid=<%# Eval("ID") %>">
                                                编辑</a>|
                                    </td>
                                </tr>
                            </table>
                        </li>
                    </ItemTemplate>
                    <FooterTemplate>
                        </ul> </div>
                    </FooterTemplate>
                </asp:Repeater>
            </td>
        </tr>
        <tr>
        <td colspan="4" >            
            <uc1:pager ID="page" runat="server" PageSize="20" ImagePath="../Images/" />
            </td>
        </tr>
    </table>
    
    </form>
</body>
</html>
